<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>员工编辑</title>
<jsp:include page="/WEB-INF/views/common/link.jsp" />
</head>
<body class="hold-transition skin-blue sidebar-mini">
	<div class="wrapper">
		<%@include file="/WEB-INF/views/common/navbar.jsp"%>
		<!--菜单回显-->
		<c:set var="currentMenu" value="employee" />
		<%@include file="/WEB-INF/views/common/menu.jsp"%>
		<div class="content-wrapper">
			<section class="content-header">
				<h1>员工编辑</h1>
			</section>
			<section class="content">
				<div class="box">
					<form class="form-horizontal" action="/employee/saveOrUpdate"
						  method="post" id="editForm">
						<input type="hidden" name="id" value="${emp.id}">
						<div class="form-group" style="margin-top: 10px;">
							<label for="username" class="col-sm-2 control-label">账号：</label>
							<div class="col-sm-6">
								<input type="text" class="form-control" id="username" name="username"
									   placeholder="请输入账号" value="${emp.username}">
							</div>
						</div>
						<div class="form-group" style="margin-top: 10px;">
							<label for="password" class="col-sm-2 control-label">密码：</label>
							<div class="col-sm-6">
								<input type="text" class="form-control" id="password" name="password"
									   placeholder="不修改密码不填写" value="${emp.password}">
							</div>
						</div>
						<div class="form-group" style="margin-top: 10px;">
							<label for="name" class="col-sm-2 control-label">姓名：</label>
							<div class="col-sm-6">
								<input type="text" class="form-control" id="name" name="name"
									   placeholder="请输入姓名" value="${emp.name}">
							</div>
						</div>
						<div class="form-group" style="margin-top: 10px;">
							<label for="email" class="col-sm-2 control-label">邮箱：</label>
							<div class="col-sm-6">
								<input type="text" class="form-control" id="email" name="email"
									   placeholder="请输入邮箱" value="${emp.email}">
							</div>
						</div>
						<div class="form-group" style="margin-top: 10px;">
							<label for="age" class="col-sm-2 control-label">年龄：</label>
							<div class="col-sm-6">
								<input type="text" class="form-control" id="age" name="age"
									   placeholder="请输入部门名" value="${emp.age}">
							</div>
						</div>
						<div class="form-group" style="margin-top: 10px;">
							<label for="hiredate" class="col-sm-2 control-label">入职日期：</label>
							<div class="col-sm-6">
								<input autocomplete="off" type="text" name="hiredate" class="form-control datetimepicker" data-date="${emp.hiredate}" id="hiredate" >
							</div>
						</div>
						<div class="form-group" style="margin-top: 10px;">
							<label for="admin" class="col-sm-2 control-label">管理员：</label>
							<div class="col-sm-6">
								<select name="admin" class="form-control" id="admin">
									<option value="false" ${!emp.admin ? "selected" : ""}>否</option>
									<option value="true" ${emp.admin ? "selected" : ""}>是</option>
								</select>
							</div>
						</div>
						<div class="form-group" style="margin-top: 10px;">
							<label for="deptId" class="col-sm-2 control-label">部门：</label>
							<div class="col-sm-6">
								<select name="admin" class="form-control" id="deptId">
									<c:forEach  var="dept" items="${departmentList}">
										<option value="${dept.id}" ${emp.dept.id == dept.id ? "selected" : ""}>${dept.name}</option>
									</c:forEach>
								</select>
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-6">
								<input type="submit" class="btn btn-primary" value="${empty emp ? '添加' : '修改'}">
							</div>
						</div>
					</form>

					<br />
				</div>
			</section>
		</div>
		<%@include file="/WEB-INF/views/common/footer.jsp"%>
	</div>

</body>
</html>
